<html manifest="IGNORE.manifest" lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css"
          th:href="@{${uiPath} + ${appName} + '/css/reset.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/CLSRZ.css"
          th:href="@{${uiPath} + ${appName} + '/css/CLSRZ.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/zdialog.css"
          th:href="@{${uiPath} + ${appName} + '/css/zdialog.css'}"/>
</head>
<body>
<div id="spxiangqigaoqi" class="azong">
    <div class="gtoubu">
        <p class="shpingunli">商品详情</p>
        <a href=""><img class="fanhui" src="../images/raw_1503386635.png" alt=""></a>
    </div>
    <div class="kuaiw"></div>
    <div class="xqfenlei">
        <div class="xleft">
            <p class="xqfirst"><b>一：大类</b></p>
            <p id="kedwos" class="xqsubfirst" th:text="${data.materialGoodsTypeBig.bigName}"></p>
            <p class="xqfirst"><b>二：中类</b></p>
            <p id="zhonleiwos" class="xqsubfirst" th:text="${data.materialGoodsTypeMiddle.middleName}"></p>
            <p class="xqfirst"><b>三：子类</b></p>
            <p id="zileidiaode" class="xqsubfirst" th:text="${data.materialGoodsTypeSmall.smallName}"></p>
            <p class="xqfirst"><b>四：资料</b></p>
        </div>
        <div class="xlright">
            <a href="../CLS/CLS_SG_ChangeShop.html " th:href="@{'/materialGoods/updateGoods?goodsId='+${data.goodsId}}">
                <p class="xqbianji">编辑商品</p>
            </a>
            <a th:onclick="'xiajia('+${data.goodsId}+','+${data.status}+')'">
                <p class="xqbianji xiajiasp" id="xiajia" th:if="${data.status}==0">下架商品</p>
                <p class="xqbianji xiajiasp" id="xiajia" th:if="${data.status}==1">已下架</p>

            </a>
            <a th:href="@{'/materialGoods/updateGoodsPin?goodsId='+${data.goodsId}}">
                <p class="xiajiashpi">拼单设置</p>
            </a>
            <a th:onclick="'shanchu('+${data.goodsId}+')'">
                <p class="xiajiashpi">删除商品</p>
            </a>
        </div>
    </div>
    <div class="xqzil xqzill">
        <ul class="xqwb xqwbb">
            <li class="xqzb">
                <p class="xqnf">商品名称：</p>
                <p id="spmingzi" class="xqnsf" th:utext="${data.goodsName}"></p>
            </li>
            <li class="xqzb">
                <p class="xqnf">商品库存量：</p>
                <p id="spkucunl" class="xqnsf" th:utext="${data.amount}"></p>
            </li>
            <li class="xqzb">
                <p class="xqnf">商品单位：</p>
                <p id="spdanweil" class="xqnsf" th:utext="${data.unit}"></p>
            </li>



            <li class="xqzb xqzbbb">
                <div class="xuancehangye">
                    <form id="anzhuagngaoqi" class="biaogexuaz" action="" method="get">是否免费安装：
                        <label class="xuazetued"><input class="yeschect" name="anzhuang" type="radio" value="1" onclick="anzhuangclick()" th:checked="${data.hasInstall==1}" /><span></span>是</label>
                        <label class="xuazetued"><input class="yeschect" name="anzhuang" type="radio" value="0" onclick="anzhuangclick()"  th:checked="${data.hasInstall==0}"/><span></span>否</label>
                    </form>

                </div>
                <p class="pinpric">安装费：</p >
                <p id="anzhuangjiage" class="xqnsf jiageemi" th:utext="${data.installPrice}"></p>
            </li>
            <li class="miaosuli">
                <p class="miaosup">商品详细描述：</p>
                <textarea name="" id="miaosu" cols="30" readonly="false" rows="10"
                          th:utext="${data.description}"></textarea>
            </li>
        </ul>
    </div>
    <p class="baikuai"></p>
    <div class="xqfive">
        <p class="xqfivet"><b>五：规格、颜色、尺寸</b></p>
        <p class="shaxqinghja">商品型号</p>
        <div class="donttianjia">
            <div th:each="goods,goosStat:${data.modelList}">
            <div id="by0" th:id="'by0'+${goods.goodsId}" class="baoxinghao">
                <p id="xh231" class="xqxinghaox" th:utext="${goods.modelName}">231</p>
                <p id="xh231" class="xqxinghaox" th:utext="${goods.size}">213</p>
                <p id="xh231" class="xqxinghaox" th:utext="${goods.color}">123</p>
                <p id="xh123" class="xqxinghaox" th:utext="${goods.price}">1231</p>
            </div>
             <img th:src="${goods.imgUrl}">
            </div>
        </div>
    </div>
    <!-- <p class="baikuai"></p>
   <div class="xqfive">
       <p class="xqfivet"><b>六：商品图片</b></p>
       <div class="xatupian">
           <p class="xqtupName">商品照片1:</p>
           <img id="tuyixl" class="xqtu5" src="../images/raw_1503973402.jpeg" alt="">
       </div>
        <div class="xatupian">
           <p class="xqtupName">商品照片2:</p>
           <img id="tuerxl" class="xqtu5" src="../images/raw_1503973407.jpeg" alt="">
       </div>
   </div> -->
    <p class="baikuai"></p>
    <div class="xqfive sevenshizi">
        <p class="xqfivet"><b>七：拼单设置</b></p>

        <div class="checkbox pinqilai">

            <div class="shifouzha">
                <ul class="tianxieme">
                    <li class="tanxiexinxi">
                        <p class="pinpric">是否已开启拼单：</p>
                        <div  th:if="${not #lists.isEmpty(data.isOpenpin)}">
                        <p id="pinsfou" class="pinrenshunum" th:if="${data.isOpenpin==1}">是</p>
                        <p id="pinsfou" class="pinrenshunum" th:if="${data.isOpenpin==0}">否</p>
                        </div>
                        <div  th:unless="${not #lists.isEmpty(data.isOpenpin)}">

                            <p id="pinsfou" class="pinrenshunum">否</p>
                        </div>

                    </li>
                    <li class="tanxiexinxi">
                        <p class="pinpric">拼团人数：</p>
                        <p id="pinrenshu" class="pinrenshunum" th:if="${not #lists.isEmpty(data.materialGoodsModelPin)}" th:utext="${data.materialGoodsModelPin.pinNums}">8</p>
                    </li>

                    <li class="tanxiexinxi">
                        <p class="pinpric">拼团周期：</p>
                        <p id="pinshijian" class="pinrenshunum" th:if="${not #lists.isEmpty(data.materialGoodsModelPin)}" th:utext="${data.materialGoodsModelPin.pinTime}">7</p>
                    </li>
                    <li class="tanxiexinxi fkkljok" th:if="${not #lists.isEmpty(data.materialGoodsModelPin)}">
                        <p class="pinpric">是否免费配送：</p>
                        <p id="pinshifoupei" class="pinrenshunum" th:if="${data.materialGoodsModelPin.pinFreeSend==1}">否</p>
                        <p id="pinshifoupei" class="pinrenshunum"  th:if="${data.materialGoodsModelPin.pinFreeSend==0}">是</p>

                        <p class="pinpric">每公里配送费：</p>
                        <p id="pinsendjigedp" class="pinrenshunum"  th:utext="${data.materialGoodsModelPin.pinSendPrice}">20</p>
                        <p class="xqnf shaongp">商品必须送货入户</p>
                    </li>
                    <li class="tanxiexinxi mianfeianz pinZAIAFEI" th:if="${not #lists.isEmpty(data.materialGoodsModelPin)}">
                        <p class="pinpric">是否免费安装：</p>
                        <p id="pinshifouanzjd" class="pinrenshunum"  th:if="${data.materialGoodsModelPin.pinHasInstall==0}">否</p>
                        <p id="pinshifouanzjd" class="pinrenshunum"  th:if="${data.materialGoodsModelPin.pinHasInstall==1}">是</p>

                        <p class="pinpric">安装费：</p>
                        <p id="pinanzhuangjiadeg" class="pinrenshunum" th:if="${not #lists.isEmpty(data.materialGoodsModelPin)}" th:text="${data.materialGoodsModelPin.pinInstallPrice}">20</p>
                    </li>
                </ul>
                <p class="shaxqinghja">拼单商品型号</p>
                <div class="pinxuanzdongtaijia">
                    <div th:each="models,modelStat: ${data.pinmodelList}" th:id="${models.modelId}">
                        <p th:id="${models.modelId}+'modelName'" class='xqxinghaox' th:text="${models.modelName}"></p>
                        <p th:id="${models.modelId}+'size'"class='xqxinghaox' th:text="${models.size}"></p>
                        <p th:id="${models.modelId}+'color'"  class='xqxinghaox' th:text="${models.color}"></p>
                        <p th:id="${models.modelId}+'price'"  class='xqxinghaox' th:text="${models.price}"></p>
                        <p th:id="${models.modelId}+'pinprice'"  class='xqxinghaox' th:text="${models.pinPrice}"></p>
                    </div>

                </div>

            </div>
        </div>

    </div>
</div>
<script type="text/javascript" src="../js/flexible.js" th:src="@{${uiPath} + ${appName} + '/js/flexible.js'}"></script>
<script type="text/javascript" src="../js/jquery.min.js" th:src="@{${uiPath} + ${appName} + '/js/jquery.min.js'}"></script>
<!-- <script type="text/javascript" src="../js/basevalue.js"></script> -->
<script type="text/javascript" src="../js/zdialog.js" th:src="@{${uiPath} + ${appName} + '/js/zdialog.js'}"></script>

<script type="text/javascript" src="../js/CLSRZ.js" th:src="@{${uiPath} + ${appName} + '/js/CLSRZ.js'}"></script>
<script th:inline="javascript">
    function xiajia(id,status){
        $.DialogByZ.Loading(/*[[${uiPath}+${appName}+'/images/loading.png']]*/);

        $.ajax({
            url:'/materialGoods/xiajiaGoods',
            data:{'goodsId':id},
            dataType:'json',
            type:'post',
            success:function (result) {
                if(result.code==1){
                    $('#xiajia').html("已下架");
                    $('#xiajia').removeAttr('onclick');
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "已下架", Content: "已下架", BtnL: "确定"});

                }else{
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "失败", Content: "请稍后再试", BtnL: "确定"});

                }

            }


        })
    }
    function shanchu(id){
        $.DialogByZ.Loading(/*[[${uiPath}+${appName}+'/images/loading.png']]*/);

        $.ajax({
            url:'/materialGoods/shanchuGoods',
            data:{'goodsId':id},
            dataType:'json',
            type:'post',
            success:function (result) {
                if(result.code==1){
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "已删除", Content: result.data, BtnL: "确定",FunL: localhref()});
                }else{
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "删除失败", Content: result.data, BtnL: "确定"});
                }
            }
        })
    }
    function localhref() {
        window.location.href = "/materialGoods/index"

    }
</script>
</body>
</html>